python如何统计list有几个连续的数字答:mylist = [1,1,0,1,1,1,0,0,0,0,1,1,1,1,0,1,0,11,0]result = {}tmp = Nonefor i in mylist: if not result.has_key(i): #新出现的值为1 result[i] = {'tmpcount':1,'maxcount':1} else: if i == tmp : #同上一次相同,tmpcount数字加一,同...
求python代码 有两组学生的名字列表,试把名字中有两个或以上字符’e...答:import renames = [['Tom','Billy','Jefferson','Andrew','Wesley','Steven','Joe'], ['Alice','Jill','Ana','Wendy','Jennifer','Sherry','Eva']]list1=[]for i in names: for j in i : #c=re.compile() d=re.match(".*e.*e.*",j)...